﻿// See https://aka.ms/new-console-template for more information

Console.WriteLine("C#的基础数据类型分为：值类型、引用类型");

Console.WriteLine("");
Console.WriteLine("值类型包括：整型、浮点型、布尔型、字符型");

Console.WriteLine("");
Console.WriteLine("整型类型分为：sbyte、byte、short、ushort、int、uint、long、ulong");

//int类型数组
int[] arr = { 1, 2, 3, 4, 5 };
Console.WriteLine($"数组的长度：{arr.Length}");
Console.WriteLine(string.Join(",",arr));//string.join方法输出数组的值
//string类型数组
string[] name = { "张三", "李四", "王五" };
//循环输出数组的值
foreach (var item in name)
{
    Console.WriteLine(item);
}



byte  by = 255;		//范围0-255
sbyte  sby = -128;	//范围-128-127
short  sho = -32768;	//范围-32768-32767
ushort usho= 65535;		//范围0-65535
int  i = 2147483647;	//范围-2147483648-2147483647
uint  ui = 4294967295;	//范围0-4294967295
long  l = 9223372036854775807;	//范围-9223372036854775808-9223372036854775807
ulong ul = 18446744073709551615;	//范围0-18446744073709551615




Console.WriteLine("");
Console.WriteLine("浮点形类型分为：float、double、decimal");

float flo=  3.14f; //范围-3.4E+38-3.4E+38
double dou= 3.14; //范围-1.7E+308-1.7E+308
decimal dec= 3.14m; //范围-7E-28-7E-28

Console.WriteLine("");
Console.WriteLine("布尔类型：bool");

bool b = true; //true、false

Console.WriteLine("");
Console.WriteLine("字符型型：char");
char c = 'a';	//字符

Console.WriteLine("");
Console.WriteLine("引用类型包括：类、接口、数组、委托");



Console.WriteLine("");
Console.WriteLine("引用类型包含：类（Class）、接口（Interface）、数组（Array）、委托（Delegate）");

//类
class  Person
{
    //成员变量
    public string name;
    //成员变量
    public int age;
    //成员方法
    public void Show()
    {
        Console.WriteLine($"姓名：{name}，年龄：{age}");//输出成员变量的值
    }
}

//接口
interface  IAnimal
{
    //成员方法
    void Show();
}

